package com.ita.service.impl;

import java.util.List;

import com.ita.dao.IUserDao;
import com.ita.dao.impl.UserDaoImpl;
import com.ita.entity.User;
import com.ita.service.IUserService;

public class UserServiceImpl implements IUserService {

	private IUserDao dao=new UserDaoImpl();
	@Override
	public boolean insertUser(User user) {

		if(dao.insertUser(user)>0){
			return true;
		}
		else{
			return false;
		}
	}

	@Override
	public User login(String userName, String password) {
		// TODO Auto-generated method stub
		return dao.login(userName, password);
	}

	@Override
	public User queryById(String userId) {
		// TODO Auto-generated method stub
		return dao.queryById(userId);
	}

	@Override
	public List<User> showAllUsers() {
		// TODO Auto-generated method stub
		return dao.queryAllUser();
	}

	@Override
	public boolean deleteById(String userId) {

		if(dao.deleteById(userId)>0){
			return true;
		}
		else{
			return false;
		}
	}

	@Override
	public boolean updateUser(User user) {
		// TODO Auto-generated method stub
		if(dao.updateUser(user)>0){
			return true;
		}
		else{
			return false;
		}
	}

}
